package com.tchhy.provider.service.healthy.impl

import com.tchhy.provider.data.common.BaseResp
import com.tchhy.provider.data.healthy.FamilyItem
import com.tchhy.basemodule.basedata.PeopleInfoEntity
import com.tchhy.provider.data.common.BindPh
import com.tchhy.network.retrofit.entity.request.PasswordVO
import com.tchhy.provider.data.common.EmptyResp
import com.tchhy.provider.data.healthy.data.MonthPeriod
import com.tchhy.provider.data.healthy.request.*
import com.tchhy.provider.data.healthy.response.*
import com.tchhy.provider.data.partner.request.NextNoticeReq
import com.tchhy.provider.data.partner.response.DataListRes
import com.tchhy.provider.repository.healthy.HealthyRepository
import com.tchhy.provider.service.healthy.HealthyService
import io.reactivex.Observable

/**
 * @author: admin
 * @date: 2019/8/20
 * @des:
 *
 **/
class HealthyServiceImpl : HealthyService {
    override fun fetchMonthPeriod(familyRelationId: String): Observable<BaseResp<ArrayList<MonthPeriod>>> {
        return healthyRepository.fetchMonthPeriod(familyRelationId)
    }

    override fun saveMonthPeriod(monthPeriod: MonthPeriod): Observable<EmptyResp> {
        return healthyRepository.saveMonthPeriod(monthPeriod)
    }

    /**
     * @description 根据用户主键获取关注数量 */
    override fun fetchAllFansFocusNum(): Observable<BaseResp<UserFansOrFacusNumEntity>> {
        return healthyRepository.fetchAllFansFocusNum()
    }


    override fun complaintUseFeedback(useComplaint: UseComplaint): Observable<EmptyResp>{
        return healthyRepository.complaintUseFeedback(useComplaint)
    }

    /**
     * @description 获取个人主页的内容列表
     * @param
     * @return
     */
    override fun fetchPeopleContentList(
        authorId: String, type: Int, pageNum: Int, pageSize: Int
    ): Observable<BaseResp<DataListRes<PersonContentSummary>>> {
        return healthyRepository.fetchPeopleContentList(authorId, type, pageNum, pageSize)
    }

    /**
     * @description 获取粉丝列表
     * @param
     * @return
     */
    override fun fetchFansList(
        authorId: String,
        pageNum: Int, pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentPeopleHeadSummary>>> {
        return healthyRepository.fetchFansList(authorId, pageNum, pageSize)
    }

    /**
     * @description 获取关注用户列表
     * @param
     * @return
     */
    override fun fetchFollowList(
        authorId: String,
        pageNum: Int, pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentPeopleHeadSummary>>> {
        return healthyRepository.fetchFollowList(authorId, pageNum, pageSize)
    }

    /**
     * @description 取消关注
     * @param
     * @return
     */
    override fun cancelFocus(
        authorId: String,
        followAuthorId: String
    ): Observable<EmptyResp> {
        return healthyRepository.cancelFocus(authorId, followAuthorId)
    }

    /**
     * @description 添加举报内容
     * @param
     * @return
     */
    override fun addComplaintContent(complaintContent: ComplaintContent): Observable<BaseResp<Boolean>> {
        return healthyRepository.addComplaintContent(complaintContent)
    }

    /**
     * @description 关注内容
     */
    override fun fetchFocusContents(
        type: Int,
        familyRelationId: String?,
        authorId: String?,
        healthIndex: ArrayList<String>?,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.fetchFocusContents(
            type,
            familyRelationId,
            authorId,
            healthIndex,
            pageNum,
            pageSize
        )
    }

    /**
     * 根据标签火圈内容
     */
    override fun fetchContentsByTag(
        tag: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.fetchContentsByTag(tag, pageNum, pageSize)
    }

    /**
     * 给用户推荐内容
     */

    override fun deletePublishContent(
        contentId: String
    ): Observable<EmptyResp> {
        return healthyRepository.deletePublishContent(contentId)
    }

    /**
     * 获取最后一条发布内容
     */
    override fun getLastContent(): Observable<BaseResp<ContentBaseEntity>> {
        return healthyRepository.getLastContent()
    }

    /**
     * @description 关注用户
     * @param
     * @return
     */
    override fun followPeople(
        focusPeopleReq: FocusPeopleReq
    ): Observable<EmptyResp> {
        return healthyRepository.followPeople(focusPeopleReq)
    }

    /**
     *判断当前用户是否填写兴趣标签
     */
    override fun checkUserAddTagResult(): Observable<BaseResp<Boolean>> {
        return healthyRepository.checkUserAddTagResult()
    }

    /**
     * LAST_WATCH_CONTENTS
     */
    override fun lastContents(): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.lastContents()
    }

    /**
     * 判断当前用户是否关注过其他用户
     */
    override fun isFollowPeople(): Observable<BaseResp<Boolean>> {
        return healthyRepository.isFollowPeople()
    }

    /**
     * @description新增标签
     * */
    override fun addTag(addMyFavoriteTag: AddMyFavoriteTag): Observable<BaseResp<Boolean>> {
        return healthyRepository.addTag(addMyFavoriteTag)
    }

    /**
     * 给用户推荐内容
     */
    override fun recommendContent(
        familyId: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.recommendContent(familyId, pageNum, pageSize)
    }

    /**
     * 同城推荐
     */
    override fun fetchLocalCityContent(
        type: Int,
        areaId: String,
        lat: String,
        lng: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.fetchLocalCityContent(type, areaId, lat, lng, pageNum, pageSize)
    }

    /**
     * 收藏的内容
     */
    override fun fetchCollectContents(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.fetchCollectContents(pageNum, pageSize)
    }


    /**
     * 获取健康指数
     */
    override fun fetchHealthIndex(id: String): Observable<BaseResp<ArrayList<String>>> {
        return healthyRepository.fetchHealthIndex(id)
    }


    /**
     * @description 搜索标签
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    override fun searchTag(keyWord: String?): Observable<BaseResp<SearchTagRes>> {
        return healthyRepository.searchTag(keyWord)
    }

    /**
     * @description 查看我所有发布的内容
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    override fun fetchMyContent(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.fetchMyContent(pageNum, pageSize)
    }

    /**
     * @description 我看过的内容
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    override fun fetchlastWatchContent(
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<ContentBaseEntity>>> {
        return healthyRepository.fetchlastWatchContent(pageNum, pageSize)
    }

    /**
     * @description 内容操作
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    override fun contentOpeartion(contentOperationReq: ContentOperationReq): Observable<EmptyResp> {
        return healthyRepository.contentOpeartion(contentOperationReq)
    }

    /**
     * @description 新增多媒体内容
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    override fun addMutiMedia(contentBaseEntity: ContentBaseEntity): Observable<EmptyResp> {
        return healthyRepository.addMutiMedia(contentBaseEntity)
    }

    /**
     * @description 呼叫药箱
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    /*override fun callMedicienChest(medicineVideoConversationReq: MedicineVideoConversationReq): Observable<EmptyResp> {
        return healthyRepository.callMedicienChest(medicineVideoConversationReq)
    }*/

    /**
     * @description 关闭聊天
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    /*override fun closeChat(
        closeChatReq: CloseChatReq
    ): Observable<EmptyResp> {
        return healthyRepository.closeChat(closeChatReq)
    }*/

    /**
     * @description 同意好友申请以及群申请
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun agreeFriendApply(
        agreeFriendApplyReq: AgreeFriendApplyReq
    ): Observable<EmptyResp> {
        return healthyRepository.agreeFriendApply(agreeFriendApplyReq)
    }

    /**
     * app添加药箱留言
     */
    override fun addMedicineChestRemindMsg(addMedicineRemainReq: AddMedicineRemainReq): Observable<EmptyResp> {
        return healthyRepository.addMedicineChestRemindMsg(addMedicineRemainReq)
    }

    /**
     * 投诉圈子
     */
    override fun complaintGroup(complaintCircleReq: ComplaintCircleReq): Observable<BaseResp<Any>> {
        return healthyRepository.complaintGroup(complaintCircleReq)
    }


    /**
     * 举报好友
     */
    override fun complaintFriend(complaintFriendReq: ComplaintFriendReq): Observable<EmptyResp> {
        return healthyRepository.complaintFriend(complaintFriendReq)
    }

    /**
     * @description 获取群好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    override fun completeInfo(completeUserInfoVO: CompleteUserInfoVO): Observable<BaseResp<PeopleInfoEntity>> {
        return healthyRepository.completeInfo(completeUserInfoVO)
    }

    /**
     * @description 修改群简介
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun changeCircleSummary(updateCircleMetaInfoReq: UpdateCircleMetaInfoReq): Observable<EmptyResp> {
        return healthyRepository.changeCircleSummary(updateCircleMetaInfoReq)
    }

    /**
     * @description 推荐好友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchRecommendFriends(): Observable<BaseResp<ArrayList<RecommendFriendRes>>> {
        return healthyRepository.fetchRecommendFriends()
    }

    /**
     * @description 获取圈子详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun getCircleDetail(groupIdIm: String): Observable<BaseResp<CircleDetailRes>> {
        return healthyRepository.getCircleDetail(groupIdIm)
    }


    /**
     * @description 获取好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    override fun fetchFriendInfo(imUserId: String): Observable<BaseResp<ArrayList<FriendInfoRes>>> {
        return healthyRepository.fetchFriendInfo(imUserId)
    }


    /**
     * @description 获取群好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    override fun fetchAllGroupId(groupId: String): Observable<BaseResp<ArrayList<FriendInfoRes>>> {
        return healthyRepository.fetchAllGroupId(groupId)
    }

    /**
     * @description 获取好友信息
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    override fun fetchFriendInCircleInfo(
        imUserId: String,
        groupIdIm: String
    ): Observable<BaseResp<ArrayList<FriendInfoRes>>> {
        return healthyRepository.fetchFriendInCircleInfo(imUserId, groupIdIm)
    }

    /**
     * @description 修改群名称
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun changCircleName(updateCircleMetaInfoReq: UpdateCircleMetaInfoReq): Observable<EmptyResp> {
        return healthyRepository.changCircleName(updateCircleMetaInfoReq)
    }

    /**
     * @description 我的圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchMyCircle(): Observable<BaseResp<ArrayList<CircleDisplayItem>>> {
        return healthyRepository.fetchMyCircle()
    }

    /**
     * @description 获取好友申请列表
     * @param
     * @return
     * @author admin
     * @time
     */
    override fun getFriendApplyList(
        imUserId: String, pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<FriendApplyItem>>> {
        return healthyRepository.getFriendApplyList(imUserId, pageNum, pageSize)
    }

    /**
     * @description 获取圈子标签列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun getCircleTag(
    ): Observable<BaseResp<ArrayList<CircleTagEntity>>> {
        return healthyRepository.getCircleTag()
    }

    /**
     * @description 添加好友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun addFriend(addFriendReq: AddFriendReq): Observable<EmptyResp> {
        return healthyRepository.addFriend(addFriendReq)
    }

    /**
     * @description 搜索附近圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun searchNearbyCircle(
        lat: Double?, lng: Double?,
        search_key: String
    ): Observable<BaseResp<ArrayList<CircleDisplayItem>>> {
        return healthyRepository.searchNearbyCircle(lat, lng, search_key)
    }

    /**
     * @description 退出圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun logoutCircle(
        groupIdIm: String
    ): Observable<EmptyResp> {
        return healthyRepository.logoutCircle(groupIdIm)
    }

    /**
     * @description 推荐圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun recommendCircles(
    ): Observable<BaseResp<ArrayList<CircleDisplayItem>>> {
        return healthyRepository.recommendCircles()
    }

    /**
     * @description 全部圈子
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    override fun fetchAllCircles(
        lat: Double?,
        lng: Double?,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<CircleDisplayItem>>> {
        return healthyRepository.fetchAllCircles(lat, lng, pageNum, pageSize)
    }

    /**
     * @description 创建群
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun createCircle(createCircleReq: CreateCircleReq): Observable<BaseResp<CircleDetailRes>> {
        return healthyRepository.createCircle(createCircleReq)
    }

    /**
     * @description 修改群个人名称
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun updateNickNameInCircle(updateCircleMemberNameReq: UpdateCircleMemberNameReq): Observable<EmptyResp> {
        return healthyRepository.updateNickNameInCircle(updateCircleMemberNameReq)
    }


    /**
     * @description 邀请好友入群
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun inviteFriendsInCircle(
        inviteFriendReq: InviteFriendReq
    ): Observable<EmptyResp> {
        return healthyRepository.inviteFriendsInCircle(inviteFriendReq)
    }

    /**
     * @description 删除群中好友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun removeFriendInCircle(
        removeFriendReq: RemoveFriendReq
    ): Observable<EmptyResp> {
        return healthyRepository.removeFriendInCircle(removeFriendReq)
    }

    /**
     * @description 加入圈子
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun joinCircle(groupIdIm: String): Observable<EmptyResp> {
        return healthyRepository.joinCircle(groupIdIm)
    }

    /**
     * @description 校验验证码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun checkCaptcha(checkCaptchaReq: CheckCaptchaReq): Observable<BaseResp<CheckCaptchaRes>> {
        return healthyRepository.checkCaptcha(checkCaptchaReq)
    }

    /**
     * @description 发送验证码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun sendCaptcha(captchaReq: CaptchaReq): Observable<EmptyResp> {
        return healthyRepository.sendCaptcha(captchaReq)
    }

    /**
     * @description 我的朋友
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchMyFriend(
        imUserId: String,
        medicineBoxId: String
    ): Observable<BaseResp<ArrayList<MyFriendItem>>> {
        return healthyRepository.fetchMyFriend(imUserId, medicineBoxId)
    }

    /**
     * @description 发送验证码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun sendCaptcha(smsVO: SmsVO): Observable<EmptyResp> {
        return healthyRepository.sendCaptcha(smsVO)
    }

    /**
     * @description 重置密码
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun forgetPassword(passwordVO: PasswordVO): Observable<EmptyResp> {
        return healthyRepository.forgetPassword(passwordVO)
    }

    /**
     * @description 微信绑定
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun bindphone(bindPh: BindPh): Observable<BaseResp<PeopleInfoEntity>> {
        return healthyRepository.bindphone(bindPh)
    }

    override fun login(loginReq: LoginReq): Observable<BaseResp<PeopleInfoEntity>> {
        return healthyRepository.login(loginReq)
    }

    override fun setFirstDosage(firstDosageReq: FirstDosageReq): Observable<BaseResp<ArrayList<String>>> {
        return healthyRepository.setFirstDosage(firstDosageReq)
    }


    override fun fetchMedicationList(
        editId: String,
        familyId: String?,
        meetId: String?,
        type: Int
    ): Observable<BaseResp<ArrayList<MedicineDosageEntity>>> {
        return healthyRepository.fetchMedicationList(editId, familyId, meetId, type)
    }

    override fun deleteUserMedicine(esId: String, id: String): Observable<EmptyResp> {
        return healthyRepository.deleteUserMedicine(esId, id)
    }

    private val healthyRepository by lazy { HealthyRepository() }


    override fun oneKeySupplement(
        oneKeySupplementReqInfo: OneKeySupplementReqInfo
    ): Observable<EmptyResp> {
        return healthyRepository.oneKeySupplement(oneKeySupplementReqInfo)
    }

    override fun getIsTonic(
        kitNo: String
    ): Observable<BaseResp<Boolean>> {
        return healthyRepository.getIsTonic(kitNo)
    }

    override fun fetchCategoryList(
        editId: String,
        coding: String,
        type: String?
    ): Observable<BaseResp<ArrayList<MedicineCategoryItem>>> {
        return healthyRepository.fetchCategoryList(editId, coding, type)
    }

    override fun fetchMedicineInfoByScan(
        editId: String,
        barCode: String
    ): Observable<BaseResp<MedicineInfo>> {
        return healthyRepository.fetchMedicineInfoByScan(editId, barCode)
    }

    override fun fetchMedicineInfoByName(
        editId: String,
        drugsName: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<MedicineInfo>>> {
        return healthyRepository.fetchMedicineInfoByName(editId, drugsName, pageNum, pageSize)
    }

    override fun fetchAllMedicineCategory(editId: String): Observable<BaseResp<ArrayList<MedicineTypeRes>>> {
        return healthyRepository.fetchAllMedicineCategory(editId)
    }

    override fun getMedicineDetail(
        medicineChestNo: String,
        medicineId: String,
        type: Int
    ): Observable<BaseResp<MedicineInfo>> {
        return healthyRepository.fetchMedicineDisplay(medicineChestNo, medicineId, type)
    }

    override fun getMedicineListDetail(
        coding: String,
        key: String?,
        medicineTypeCode: String?,
        type: String?
    ): Observable<BaseResp<MedicinesSourceList>> {
        return healthyRepository.fetchMedicineDisplay(coding, key, medicineTypeCode, type)
    }

    override fun addStockMedicine(medicineInfo: MedicineReqInfo): Observable<EmptyResp> {
        return healthyRepository.addStockMedicine(medicineInfo)
    }

    override fun fetchAllMedicines(
        editId: String,
        medicineName: String?,
        pageNum: Int,
        pageSize: Int,
        typeName: String
    ): Observable<BaseResp<DataListRes<MedicineEntity>>> {
        return healthyRepository.fetchAllMedicines(
            editId,
            medicineName,
            pageNum,
            pageSize,
            typeName
        )
    }


    /**
     * @description 获取家庭列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchAllFamily(
        id: String
    ): Observable<BaseResp<ArrayList<FamilyItem>>> {
        return healthyRepository.fetchFamilyList(id)
    }

    /**
     * @description 新增家庭成员
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun joinFamily(familyMemberShipReq: FamilyMemberShipReq): Observable<BaseResp<ActiveChestRes>> {
        return healthyRepository.joinFamily(familyMemberShipReq)
    }

    /**
     * @description 短信提醒创建账号
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun addUserBySms(id: String, phone: String, code: String): Observable<EmptyResp> {
        return healthyRepository.addUserBySms(id, phone,code)
    }


    /**
     * @description 获取家庭个人详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchFamilyUserInfo(
        id: String
    ): Observable<BaseResp<PersonDetailInfoRes>> {
        return healthyRepository.fetchFamilyUserInfo(id)
    }


    /**
     * @description 更新家庭个人详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun updateProfileDetail(editUserProfile: EditUserProfile): Observable<EmptyResp> {
        return healthyRepository.updateProfileDetail(editUserProfile)
    }

    /**
     * @description 修改家庭名称
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun setFamilyName(
        editId: Long,
        familyId: String,
        familyName: String
    ): Observable<EmptyResp> {
        return healthyRepository.setFamilyName(editId, familyId, familyName)
    }

    /**
     * @description 激活药箱
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun activeMedicineBox(activeChestReq: ActiveChestReq): Observable<BaseResp<ActiveMedicineRes>> {
        return healthyRepository.activityMedicineBox(activeChestReq)
    }


    /**
     * @description 设置默认家庭
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun setDefaultFamily(
        editId: Long,
        familyId: String,
        id: Long
    ): Observable<BaseResp<Long>> {
        return healthyRepository.setDefaultFamily(editId, familyId, id)
    }


    /**
     * @description 解除药箱关系
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun deleteMemberOfChest(id: String): Observable<EmptyResp> {
        return healthyRepository.deleteMemberOfChest(id)
    }


    /**
     * @description 获取药箱详情
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchMedicineBox(
        editId: Long,
        medicineCode: String
    ): Observable<BaseResp<MedicineBoxInfo>> {
        return healthyRepository.fetchMedicineBox(editId, medicineCode)
    }

    /**
     * @description 获取家庭成员列表
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchAllFamilyMember(
        editId: Long,
        familyId: String,
        id: Long
    ): Observable<BaseResp<ArrayList<FamilyMemberShipItem>>> {
        return healthyRepository.fetchAllFamilyMember(editId, familyId, id)
    }

    /**
     * @description 通知药箱二维码扫描成功
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun notifyMedicineBox(
        timeCode: String,
        editId: Long,
        medicineCode: String
    ): Observable<EmptyResp> {
        return healthyRepository.notifyMedicineBox(timeCode, editId, medicineCode)
    }

    /**
     * @description 通过扫描添加家庭成员
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun addFamilyMemberByScan(activeFamilyMemberByScan: ActiveFamilyMemberByScan): Observable<BaseResp<ActiveChestRes>> {
        return healthyRepository.addFamilyMemberByScan(activeFamilyMemberByScan)
    }

    /**
     * @description 获取im个人主页
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun getImInfo(
        imUserId: String,
        familyId: String
    ): Observable<BaseResp<FriendInfoNewRes>> {
        return healthyRepository.getImInfo(imUserId, familyId)
    }


    /**
     * @description 绑定药箱
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun bindingMedicine(
        timeCode: String,
        editId: Long,
        medicineCode: String,
        type: Int
    ): Observable<EmptyResp> {
        return healthyRepository.bindingMedicine(timeCode, editId, medicineCode, type)
    }


    /**
     * @description 修改家庭成员备注名
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun updateRemarkName(updateRemarkNameReq: UpdateRemarkNameReq): Observable<EmptyResp> {
        return healthyRepository.updateRemarkName(updateRemarkNameReq)
    }


    /**
     * @description 修改IM备注名
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun updateFriendRemarkName(updateFriendRemarkReq: UpdateFriendRemarkReq): Observable<EmptyResp> {
        return healthyRepository.updateFriendRemarkName(updateFriendRemarkReq)
    }

    /**
     * @description 体重最近7次记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchWeightRecordList(
        editId: Long,
        familyRelationId: String
    ): Observable<BaseResp<ArrayList<WeightItemRes>>> {
        return healthyRepository.fetchWeightRecordList(editId, familyRelationId)
    }


    /**
     * @description 保存身高体重
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun saveWeightRecord(weightItemReq: WeightItemReq): Observable<EmptyResp> {
        return healthyRepository.saveWeightRecord(weightItemReq)
    }


    /**
     * @description 步数最近7次记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchStepRecordList(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<StepRecordRes>>> {
        return healthyRepository.fetchStepRecordList(editId, familyRelationId)
    }


    /**
     * @description 保存步数
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun saveStepRecord(stepRecordRes: StepRecordRes): Observable<EmptyResp> {
        return healthyRepository.saveStepRecord(stepRecordRes)
    }


    /**
     * @description 获取用户家庭排行
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchRankByStep(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<FamilyMemberRankItem>>> {
        return healthyRepository.fetchRankByStep(editId, familyRelationId)
    }


    /**
     * @description 获取血压最近记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchBloodPressureRecordList(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<BloodPressureItemRes>>> {
        return healthyRepository.fetchBloodPressureRecordList(editId, familyRelationId)
    }

    /**
     * @description 保存血压
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun saveBloodPressureRecord(bloodPressureReq: BloodPressureReq): Observable<EmptyResp> {
        return healthyRepository.saveBloodPressureRecord(bloodPressureReq)
    }

    /**
     * @description 获取血糖最近记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchBloodSugarRecordList(
        editId: Long,
        familyRelationId: Long
    ): Observable<BaseResp<ArrayList<BloodSugarItem>>> {
        return healthyRepository.fetchBloodSugarRecordList(editId, familyRelationId)
    }

    /**
     * @description 保存血糖
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun saveBloodSugarRecord(bloodSugarReq: BloodSugarReq): Observable<EmptyResp> {
        return healthyRepository.saveBloodSugarRecord(bloodSugarReq)
    }

    /**
     * @description app用户健康档案
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchUserHealthData(
        familyRelationId: String
    ): Observable<BaseResp<HealthFileDataRes>> {
        return healthyRepository.fetchUserHealthData(familyRelationId)
    }

    override fun getHealthScoreDetail(
        familyRelationId: Long
    ): Observable<BaseResp<HealthScoreDetailRes>> {
        return healthyRepository.getHealthScoreDetail(familyRelationId)
    }

    /**
     * @descriptionapp app首页用户画像
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchMainPageUserPortrait(
        familyRelationId: String
    ): Observable<BaseResp<ArrayList<MainPageUserInfo>>> {
        return healthyRepository.fetchMainPageUserPortrait(familyRelationId)
    }


    /**
     * @description 健康记录分页
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchHealthRecordList(
        editId: Long,
        familyRelationId: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<DataListRes<HealthRecordItem>>> {
        return healthyRepository.fetchHealthRecordList(editId, familyRelationId, pageNum, pageSize)
    }


    /**
     * @description 手动增加健康记录
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun addHealthRecord(healthRecordItem: HealthRecordItem): Observable<EmptyResp> {
        return healthyRepository.addHealthRecord(healthRecordItem)
    }

    /**
     * @description 问卷评估列表
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    override fun fetchQuestionList(editId: Long, familyRelationId: Long)
            : Observable<BaseResp<ArrayList<QuestionItem>>> {
        return healthyRepository.fetchQuestionList(editId, familyRelationId)
    }

    /**
     * @description 获取兴趣标签
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun fetchTag(): Observable<BaseResp<ArrayList<InterestEntry>>> {
        return healthyRepository.fetchTag()
    }

    /**
     * @description 获取药箱连接状态
     * @param
     * @return
     * @author admin
     * @time 2019/10/16
     */
    override fun getMedicineConnectionStatus(familyId: String): Observable<BaseResp<KitConnectionStatusRes>> {
        return healthyRepository.getMedicineConnectionStatus(familyId)
    }

    /**
     * @description 用药提醒吃药
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    override fun takeMedicine(takeMedicineReq: TakeMedicineReq): Observable<EmptyResp> {
        return healthyRepository.takeMedicine(takeMedicineReq)
    }

    /**
     * @description 用药提醒获取计划详情
     * @param
     * @return
     * @author admin
     * @time 2019/10/23
     */
    override fun endTakeMedicine(endTakeMedicineReq: EndTakeMedicineReq): Observable<EmptyResp> {
        return healthyRepository.endTakeMedicine(endTakeMedicineReq)
    }


    override fun getFamilyMember(
        familyId: String,
        id: String
    ): Observable<BaseResp<ArrayList<FamilyMemberData>>> {
        return healthyRepository.getFamilyMember(familyId, id)
    }

    /**
     * 获取提醒详情
     */
    override fun getPlanDetails(
        appMedicationTime: String,
        medicationPlanId: String
    ): Observable<BaseResp<ArrayList<TakeMedicineRes>>> {
        return healthyRepository.getPlanDetails(appMedicationTime, medicationPlanId)
    }

    /**
     * 用药提醒判断当前提醒是否可以延后
     */
    override fun judgeNextMedicationTime(nextNoticeReq: NextNoticeReq): Observable<EmptyResp> {
        return healthyRepository.judgeNextNoticeTime(nextNoticeReq)
    }

    override fun calculateMedicationPlan(planData: MedicinePlanReq): Observable<BaseResp<ArrayList<DrinkDrugsPlanData>>> {
        return healthyRepository.calculateMedicationPlan(planData)
    }

    override fun createMedicationPlan(data: CreateMedicationPlanData): Observable<BaseResp<String>> {
        return healthyRepository.createMedicationPlan(data)
    }


    override fun getKitTemperatureHumidity(medicinalCode: String): Observable<BaseResp<KitStatusRes>> {
        return healthyRepository.getKitTemperatureHumidity(medicinalCode)
    }

    override fun getClassification(
        coding: String,
        type: String
    ): Observable<BaseResp<ArrayList<DrugClassificationRes>>> {
        return healthyRepository.getClassification(coding, type)
    }

    /**
     * @description 判断发布内容权限
     * @param
     * @return
     * @author admin
     * @time 2019/10/30
     */
    override fun contentAuthority(
    ): Observable<EmptyResp>{
        return healthyRepository.contentAuthority()
    }

    override fun quickMedicineCommonList(
        coding: String,
        key: String?,
        medicineTypeCode: String,
        type: String?
    ): Observable<BaseResp<AllMedicationRes>> {
        return healthyRepository.quickMedicineCommonList(coding, key, medicineTypeCode, type)
    }

    /**
     * @description 搜索用户
     * @param
     * @return
     * @author admin
     * @time 2019/8/20
     */
    override fun searchFriend(param: String): Observable<BaseResp<MyFriendItem>> {
        return healthyRepository.searchFriend(param)
    }

    /**
     * @description 检查版本更新
     * @param
     * @return
     * @author admin
     * @time 2019/9/9
     */
    override fun checkUpdate(): Observable<EmptyResp> {
        return healthyRepository.checkUpdate()
    }

    override fun getCardNumBelongToBank(cardNumber: String): Observable<BaseResp<String>> {
        return healthyRepository.getCardNumBelongToBank(cardNumber)
    }

    override fun addBankCard(addBankCardReq: AddBankCardReq): Observable<EmptyResp> {
        return healthyRepository.addBankCard(addBankCardReq)
    }


    override fun getIsAllowChangeMedicine(chestCode: String): Observable<BaseResp<Boolean>> {
        return healthyRepository.getIsAllowChangeMedicine(chestCode)
    }

    //获取药箱内的厂商药
    override fun getMedicineTypeList(
        chestCode: String,
        typeCode: String?
    ): Observable<BaseResp<MedicineChangeTypeListRes>> {
        return healthyRepository.getMedicineTypeList(chestCode, typeCode)
    }


    override fun getMedicineTarget(
        typeCode: String?,
        size: String?,
        pageNum: Int?,
        pageSize: Int?
    ): Observable<BaseResp<MedicineTargetRes>> {
        return healthyRepository.getMedicineTarget(
            typeCode,
            size,
            pageNum,
            pageSize
        )
    }

    override fun getChangeMedicineOrderDetail(replaceOrderId: String): Observable<BaseResp<ChangeMedicineOrderDetailRes>> {
        return healthyRepository.getChangeMedicineOrderDetail(replaceOrderId)
    }

    override fun getChangeMedicineOrders(
        chestCode: String,
        pageNum: Int,
        pageSize: Int
    ): Observable<BaseResp<ChangeMedicineOrdersRes>> {
        return healthyRepository.getChangeMedicineOrders(
            chestCode,
            pageNum,
            pageSize
        )
    }


    override fun submitChangeMedicine(submitChangeMedicineReq: SubmitChangeMedicineReq): Observable<EmptyResp> {
        return healthyRepository.submitChangeMedicine(submitChangeMedicineReq)
    }

    override fun getTargetMedicineType(): Observable<BaseResp<List<TargetMedicineTypeRes>>> {
        return healthyRepository.getTargetMedicineType()
    }

    override fun getHelpCentreInfo(): Observable<BaseResp<ArrayList<HelpCentreRes>>>{
        return healthyRepository.getHelpCentreInfo()
    }

    override  fun getServiceProtocolList(): Observable<BaseResp<ArrayList<ServiceProtocolRes>>>{
        return healthyRepository.getServiceProtocolList()
    }

    override  fun getServiceProtocolDetail(agreementId: String): Observable<BaseResp<ServiceProtocolRes>>{
        return healthyRepository.getServiceProtocolDetail(agreementId)
    }

    override fun getCommontProtocol(agreementId: String): Observable<BaseResp<ServiceProtocolRes>>{
        return healthyRepository.getCommontProtocol(agreementId)
    }

    override fun addNoDisturbCircle(groupIdIm: String):Observable<BaseResp<Any>>{
        return healthyRepository.addNoDisturbCircle(groupIdIm)
    }

    override fun cancelMesDisturb(groupIdIm: String): Observable<BaseResp<Any>>{
        return healthyRepository.cancelMesDisturb(groupIdIm)
    }

    override fun getAllDisturbMsgId(): Observable<BaseResp<ArrayList<String>>>{
        return healthyRepository.getAllDisturbMsgId()
    }

    override fun getConsultationTime(): Observable<BaseResp<VipDurationRes>> {
        return healthyRepository.getConsultationTime()
    }

    override fun isFriend(customerAccount: String): Observable<BaseResp<IsFriendRes>>{
        return healthyRepository.isFriend(customerAccount)
    }




}